import { Router } from "@/router/index.tsx";
import { connect, useDispatch } from "react-redux";
import { useEffect } from "react";
import { UserLevel } from "@/router/baseRouter.tsx";
import { changeUserAction } from "@/redux/module/user.ts";

const App = ({ changeUser }) => {
  useEffect(() => {
    changeUser(UserLevel["ADMIN"]);
  }, []);
  return <Router></Router>;
};

export default connect(null, (dispatch) => {
  return {
    changeUser: (data) => {
      dispatch(changeUserAction(data));
    },
  };
})(App);
